﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using ProgrammingSchool.Infrastructure.Filters.Authorize;
using System.IO;
using ProgrammingSchool.Models.Shared;

namespace ProgrammingSchool.Controllers
{
    public class HomeController : Controller
    {
        [AllowAnonymous]
        public ActionResult Index()
        {
            var model = new DirectoryInfo(Server.MapPath("/Content/Images/"))
                                            .GetFiles()
                                            .Select(u => "/Content/Images/" + u.Name)
                                            .ToList();
            return View(model);
        }

        [AllowAnonymous]
        public ActionResult Contacts()
        {
            return View();
        }

        [AllowAnonymous]
        public ActionResult About()
        {
            return View();
        }

        [AllowAnonymous]
        [HttpPost]
        public ActionResult FeedBack(FeedBackModel model)
        {
            //_emailService.Send("FeedBack Message",
            //                     "Registration on Programming School site",
            //                     user.Login);
            return PartialView("FeedBack", new FeedBackModel());
        }
    }
}
